module SQS4Rails; end 

class SQS4Rails::Poller

  def self.subscribe(queue_name, &block)
    while true
      while !SQSLogger.messages?(queue_name); end
      payload = SQSLogger.read(queue_name)
      yield(payload) if payload
    end
  end
  
end